package com.zzl.test.resp;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Description：模拟redis服务，用于拦截redis客户端的消息
 * Created by 朱正磊 on 2019-09-23 14:38
 */
public class RedisVM {

    /**
     * description：收音机，拦截redis通信
     * user 朱正磊
     * time 2019-09-23 14:40
     * @param args
     */
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(6378);
        Socket socket = serverSocket.accept();
        byte[] request = new byte[1024];
        InputStream inputStream = socket.getInputStream();
        inputStream.read(request);
        System.out.println(new String(request));
        socket.close();
        serverSocket.close();
    }

}
